<?php
declare (strict_types = 1);

namespace app\admin\controller;
use app\BaseController;
use think\facade\Db;
use think\facade\Request;
use think\facade\View;

class Order extends BaseController
{
    public function orderList()
    {
        $post = Request::post();

        $where=[];
        $order_sn=Request::post('order_sn');

        if (isset($order_sn) && $order_sn<>'')$where[]=['order_sn','like',"%{$order_sn}%"];
        if (isset($post['addtime']) && $post['addtime']<>'')$where[]=['addtime','> TIME',$post['addtime']];
        if (isset($post['addtimes']) && $post['addtimes']<>'')$where[]=['addtime','< TIME',$post['addtimes']];

        if (isset($post['d_price']) && $post['d_price']<>'')$where[]=['price','>',$post['d_price']];
        if (isset($post['g_price']) && !empty($post['g_price']))$where[]=['price','<',$post['g_price']];

        if (isset($post['cid']) && $post['cid']<>'')$where[]=['status','in',$post['cid']];

        $order=Db::table('ecm_order')->where($where)->select();
        View::assign('order',$order);
        View::assign($post);

        $user=Db::table('ecm_user')->select();
        View::assign('user',$user);

        $statu = Db::table('ecm_order_status')->select();
        View::assign('statu',$statu);


        return view();
    }

    public function orderDetail()
    {
        return view();
    }
}







